<?php


namespace RedMVC\Form\Validator;
use RedMVC;

/**
 * AValidator class
 *  
 * @category    RedMVC
 * @package     Form
 * @subpackage  Validator 
 * @author      Jan Fischer, bitWorking <info@bitworking.de>
 */
abstract class AValidator{
    
    protected $_error = null;
    
    protected function setError($error, $value = null){
        $translate = RedMVC\Registry::get('RedMVC_Translate');
        $this->_error = sprintf($translate->_($error), $value);
    }
    
    public function getError(){
        return $this->_error;
    }

    abstract public function isValid($value, $formValues = null);
}